package com.wnzt.baszh.util.common;


/**
 * 返回给前台的json对象。如果操作成功，设置result为JsonConstant.SUCC，查询类有返回值的话，将查询结果放入outdata里。
 * 如果操作失败，result为JsonConstant.FAIL，同時设置错误信息到msg中。
 * 
 * @author ZT100045
 * 
 */
public class JsonResult {
	/**
	 * 返回标志1：代表成功 否则代表失败
	 */
	private int result = 1;

	/**
	 * 如果resultcode！=0，msg返回失败信息
	 */
	private String msg;

	/**
	 * 如果resultcode=0,需要返回则给前台的3个值
	 */

	/**
	 * id此处无意义，默认给个1
	 */
	private int id = 1;
	/**
	 * 查询出来的总条数
	 */
	private int totalCount;

	/**
	 * 每页显示的条数
	 */
	private Object data;

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public int getResult() {
		return result;
	}

	public void setResult(int result) {
		this.result = result;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	public JsonResult() {
		super();
	}

	public JsonResult(int result, String msg) {
		super();
		this.result = result;
		this.msg = msg;
	}
	public JsonResult(int result, int totalCount, Object data) {
		super();
		this.result = result;
		this.totalCount = totalCount;
		this.data = data;
	}

	public JsonResult(int result, Object data) {
		super();
		this.result = result;
		this.data = data;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

}
